<template>
  <div>
    <h2>vue3 ts cmn</h2>
    <el-input v-model="input" placeholder="Please input" />
    <el-button type="danger">危险</el-button>
    <i class="el-icon-user-solid"></i>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import zjRequest from '../service'
export default defineComponent({
  setup() {
    console.log(process.env.VUE_APP_BASE_URL)
    console.log(process.env.VUE_APP_BASE_NAME)
    interface DataType {
      data: any
      returnCode: string
      success: boolean
    }
    zjRequest
      .request<DataType>({
        url: '/home/multidata',
        method: 'GET',
        showLoading: true,
        interceptors: {
          requestInterceptor: (config) => {
            // console.log(config)
            console.log('单独接口的请求成功拦截')
            return config
          },
          responseInterceptor: (res) => {
            // console.log(res)
            console.log('单独接口的相应成功拦截')
            return res
          }
        }
      })
      .then((res) => {
        console.log(res.data)
      })
    return {
      input: ref('')
    }
  }
})
</script>
<style scoped></style>
